
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.ssh.entity.Users;
public class Main {
	@SuppressWarnings("deprecation")
	public static void main(String[] args) {
		Configuration config = new Configuration().configure();
		SessionFactory sessionFactory = config.buildSessionFactory();
		Session session = sessionFactory.openSession();
		
		/**
		 * Load  查询缓存   
		 * get   不会查询缓存 
		 */
		List<Users> list = session.createQuery("from Users").list();
		for (Users users : list) {
			System.out.println(users.getUser_code());
		}
		session.close();
	}
}
